import react from '@vitejs/plugin-react-swc'

import unocss from './unocss'
import createVitePluginRemoveConsole from './vite-plugin-remove-console'
import createRollupPluginVisualizer from './rollup-plugin-visualizer'
import createVitePluginHtml from './vite-plugin-html'
import codeInspectorPlugin from './code-inspector-plugin'

export default function createVitePlugins(mode: string) {
  const vitePlugins: any[] = []
  vitePlugins.push(react())
  vitePlugins.push(unocss())
  vitePlugins.push(createVitePluginRemoveConsole())
  vitePlugins.push(createRollupPluginVisualizer())
  vitePlugins.push(createVitePluginHtml())
  vitePlugins.push(codeInspectorPlugin())

  return vitePlugins
}
